﻿using Tanmia.Basis.Core;

namespace Tanmia.Basis.ViewModel
{
    /// <summary>
    /// Represent how the BrowserViewModel navigate among its records.
    /// </summary>
    /// <typeparam name="TCore">The Business Entity Type which is passed to the BrowserViewModel.</typeparam>
    public interface IBusinessEntityNavigator<TCore>
        where TCore : BaseBusinessObject
    {
        /// <summary>
        /// Gets the selected entity on the Browser Window.
        /// </summary>
        TCore CurrentEntity { get; }

        /// <summary>
        /// Gets a value determine if the CurrentEntity is standing at the first Record.
        /// </summary>
        bool IsAtFirst { get; }

        /// <summary>
        /// Gets a value determine if the CurrentEntity is standing at the last Record.
        /// </summary>
        bool IsAtLast { get; }

        /// <summary>
        /// Move CurrentEntity back to the previous record.
        /// </summary>
        void MoveToPrevious();

        /// <summary>
        /// Move CurrentEntity forward to the next record.
        /// </summary>
        void MoveToNext();

        /// <summary>
        /// Move CurrentEntity top to the first record.
        /// </summary>
        void MoveToFirst();

        /// <summary>
        /// Move CurrentEntity down to the last record.
        /// </summary>
        void MoveToLast();
    }
}
